#!/bin/bash
workspace=$1
tmp=~/.cache/hyprland/workspace

activeWorkspace=$(hyprctl -j activeworkspace|jq '.id')
if [[ $workspace == $activeWorkspace || $workspace == 0 ]];then
    hyprctl dispatch workspace $(cat $tmp)
else
    hyprctl dispatch workspace $workspace
fi
echo $activeWorkspace > $tmp
